In [ ]:
# Import modules that contain functions we need
import pandas as pd
import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
In [ ]:
# Our data is the dichotomous key table and is defined as the word 'key'.
# key is set equal to the .csv file that is read by pandas.
# The .csv file must be in the same directory as the program.
#If the data is being pulled locally use the code that is commented out below
#key = pd.read_csv("Classification of Organisms- Jupyter Data.csv")
#key2 = pd.read_csv("Classification of Organisms- Jupyter Data KEY 2.csv")
key = pd.read_csv("https://gist.githubusercontent.com/GoodmanSciences/f4d51945a169ef3125234c57b878e058/raw/bebeaae8038f0b418ed37c2a98b82aa9d3cc38d1/Classification%2520of%2520Organisms-Jupyter%2520Data.csv")
key2 = pd.read_csv("https://gist.githubusercontent.com/GoodmanSciences/4060d993635e90cdcc46fe637c92ee37/raw/d9031747855b9762b239dea07a60254eaa6051f7/Classification%2520of%2520Organisms-%2520Jupyter%2520Data%2520KEY%25202.csv")
# This sets Organism as the index instead of numbers
#key = data.set_index("organism")
a tool that allows scienctists to identify and classify organisms in the natural world. Based on their characterists, scienctists can narrow down species into groups such as trees, flowers, mammals, reptiles, rocks, and fish. A Dichotomous Key can help to understand how scientists have classified organisms using Bionomial Nomenclature.
In [ ]:
# Here is a helpful image of a sample Dichotomous Key!
from IPython.display import Image
from IPython.core.display import HTML
Image(url= 'http://biology-igcse.weebly.com/uploads/1/5/0/7/15070316/8196495_orig.gif')
In [ ]:
# Animal options in Dichotomous Key
# Displays all row titles as an array
key.organism
In [ ]:
# Conditions/Questions for finding the correct animal
# Displays all column titles as an array
key.columns
These are the conditions or the characteristics in which ceratin answers are categorized for certain organisms. Each characteristic/condition has a yes/no except for the Kingdoms. Change the conditionals in the code below to change what organism(s) are displayed. For most, the only change needs to be the 'yes' or 'no'.
Capitalization matters so be careful. You also must put in only allowed answers in every condition or the code will break!
In [ ]:
key[(key['decomposer'] == 'yes')]
In [ ]:
# This conditional allows us to query a column and if the data within that cell matches it will display the animal(s).
#if you are unsure of what to put try making that column a comment by adding # in front of it.
key[
#physical characteristics
(key['fur'] == 'yes') & \
(key['feathers'] == 'no') & \
(key['poisonous'] == 'no') & \
(key['scales'] == 'no') & \
(key['multicellular'] == 'yes') & \
(key['fins'] == 'no') & \
(key['wings'] == 'no') & \
(key['vertebrate'] == 'yes') & \
#environmental characteristics
(key['marine'] == 'no') & \
(key['terrestrial'] == 'yes') & \
#feeding characteristics
#decomposers get their food by breaking down decaying organisms
(key['decomposer'] == 'no') & \
#carnivores get their food by eating animals
(key['carnivore'] == 'no') & \
#herbivores get their food by eating plants
(key['herbivore'] == 'yes') & \
#omnivores get their food by eating both plants and animals
(key['omnivore'] == 'no') & \
#photosynthesis is the process of making food using energy from sunlight
(key['photosynthesis'] == 'no') & \
#autotrophs are organisms that generate their own food inside themselves
(key['autotroph'] == 'no') & \
#possible kingdoms include: animalia, plantae, fungi
(key['kingdom'] == 'animalia') & \
#cell type
(key['eukaryotic'] == 'yes') & \
(key['prokaryotic'] == 'no')
]
In [ ]:
#sort your organisms by their taxonomical classification
# This conditional allows us to query a column and if the data within that cell matches,
# it will display the corresponding animal(s)
key2[(key2['kingdom'] == 'animalia')]
In [ ]:
#Done?? Insert a image for one of the organisms you found using the dichotomous key.
from IPython.display import Image
from IPython.core.display import HTML
Image(url= 'https://lms.mrc.ac.uk/wp-content/uploads/insert-pretty-picture-here1.jpg')